package com.fasteat.menu.controller;


import com.fasteat.common.entity.Result;
import com.fasteat.menu.service.MaterialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author run
 * @since 2021-01-19
 */
@Api(tags = "菜谱用料相关接口")
@CrossOrigin
@RestController
@RequestMapping("/fasteat/material")
public class MaterialController {

    @Autowired
    private MaterialService materialService;

    @GetMapping("menuMaterial/{id}")
    @ApiOperation("获取菜谱的用料信息")
    public Result searchMaterialsOfMenu(@PathVariable(value = "id") String menuId){
        return Result.success().data(materialService.searchMaterialsOfMenu(menuId));
    }
}

